package com.openFire.action;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.openFire.Base.OpenFireBaseAction;
import com.openFire.entity.User;
import com.schooldate.util.SimpleJsonFilter;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

/**
 * Created by etund on 2015/4/17 0017.
 */
@Controller
@Scope("prototype")
@SuppressWarnings("all")
public class UserAction extends OpenFireBaseAction<User>{

    public void getAllUser() throws Exception{
        users =   this.userService.findAll();
        SimpleJsonFilter filter = new SimpleJsonFilter("openFireUser");
        object.put("users",users);
        result = JSON.toJSONString(object, filter, SerializerFeature.DisableCircularReferenceDetect);
        System.out.println(result+"===================");
        renderJson(result);
    }

}
